const AccessToken = 'Basic YnJvd3Nlcjpicm93c2Vy'
const TokenPrefix = 'Bearer '

const isLogin = () => {
  return !!sessionStorage.getItem('token') || !!localStorage.getItem('token')
}

const getToken = () => {
  return sessionStorage.getItem('token') || localStorage.getItem('token')
}

const setToken = (token: string) => {
  sessionStorage.setItem('token', token)
}

const clearToken = () => {
  sessionStorage.removeItem('token')
}

export { AccessToken, TokenPrefix, isLogin, getToken, setToken, clearToken }
